1. Iterate through key rules. For each key rule:
  a) Get the scan code.  Lookup the US VK for that scan code.
  b) Get the output char and shift state.
  c) For each Keyman rule with that output char, replace with the US VK from (a) and shift from (b)
  d) For each Keyman rule with virtual char key and shift state match, replace with shift state from (d) and US VK from (a)
  e) If output is a deadkey, then generate a rule for that deadkey, US VK -> dk(n)
  f) For each deadkey, locate rules that have that output character, and append dk(n) to context, and replace keystroke per (a) and (b)
  

  
For deadkeys,  
2. 
2. For each scan code, determine the char cap, 

 + 'q' > 'zip'
 
 + [K_A] > 'zip'
 
 
 key with 'q' ==> K_Q ==> scan 0x1E on FR ==> VK_A on US
 
 
 
 + '$' > 'zam'
 
 + [K_RBRKT] > 'zam'
 